<template>
	<view :class="AppStyle">
		<view class="comment-list">
			<!-- 评论记录列表-start -->
			<view class="comment-box-item" v-for="(item, index) in datas">
				<view class="">
					<view class="msg-top">
						<view class="comment-main">
							<!-- 父评论体-start -->
							<view class="nick-name-box">
								<span class="nick-name">
									{{item.likeUserCount}} 人点赞了您的评论
								</span>
								<i class="zi zi_eye" style="color: red;font-size: 10rpx;line-height: 30rpx;"></i>
							</view>
							<view class="reply-box">
								<view class="reply-time">
									{{item.likeTime}}
								</view>
							</view>
						</view>
					</view>
					<view class="my-reply-box">
						<view class="my-comment-box">
							<span class="my-comment-title">我的评论:</span>
							<span class="my-comment-content">
								{{item.myReplyContent.length > 60 ? interruptStr(item.myReplyContent, 59) : item.myReplyContent}}
							</span>
						</view>
						<view class="comment-sub-box">
							<view class="source-box">
								<view>
									<image :src="item.parSource.sourceLogoUrl" mode="aspectFill" class="img">
									</image>
								</view>
								<view class="content">
									{{item.parSource.content.length > 60 ? interruptStr(item.parSource.content, 59): item.parSource.content}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="load-more">
			<text v-if="showMoreBotton">{{moreText}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				AppStyle: 'bg-wite-page commom-margin',
				datas: [{
					"id": 1, // 唯一主键
					"likeTime": "2023-05-02 12:23",
					"readStatus": 1, // 1：未读；2：已读
					"likeUserCount": 3,
					"myReplyContent": "终南山到底是个什么样子的人，也只有历史来评判！么样子的人，也只有历史来评判！么样子的人，也只有历史来评判！我们现在所说的都是自己的想法",
					"parSource": {
						"sourceLogoUrl": "https://inews.gtimg.com/newsapp_ls/0/13797755537/0",
						"content": "你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗？",
						"id": 1,
						"sourceType": 1, // 1:投票；2:资讯
					}
				},
				{
					"id": 2, // 唯一主键
					"likeTime": "2023-05-02 11:11",
					"readStatus": 1, // 1：未读；2：已读
					"likeUserCount": 10,
					"myReplyContent": "美丽国真的不咋地，自以为是",
					"parSource": {
						"sourceLogoUrl": "https://inews.gtimg.com/newsapp_ls/0/13797755537/0",
						"content": "你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗你赞成春节不调休吗？",
						"id": 1,
						"sourceType": 1, // 1:投票；2:资讯
					}
				}],
				showMoreBotton: true,
				moreText: '加载更多'
			}
		},
		methods: {
			interruptStr(str, length) {
				return str.slice(0, length) + '...'
			}
		}
	}
</script>

<style lang="scss" scoped>
	.comment-box-item {
		padding: 20rpx 0;
		// border-top: 1px solid #ccc;
		// box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	}

	.msg-top {
		display: flex;
	}

	.avatar {
		width: 70rpx;
		height: 70rpx;
		border-radius: 50%;
	}

	.comment-main {
		width: 100%;
	}

	.nick-name-box {
		padding-top: 6rpx;
		display: flex;
		justify-content: space-between;
		

		.nick-name {
			color: #8D8C91;
			font-weight: bold;
			margin-right: 10rpx;
			font-size: 25rpx;
		}
	}

	.reply-box {
		display: flex;

		.reply-time {
			font-size: 5rpx;
			color: #8D8C91;
			margin-top: 10rpx;
			width: 90%;
		}

		.comment-main-btn {
			margin-left: 10rpx;
			font-size: 12rpx;
			color: #8D8C91;
			line-height: 32rpx;
		}
	}


	.sub-comment-main-top {
		width: 100%;
		padding-top: 6rpx;
		display: flex;
		justify-content: space-between;
	}

	.comment-sub-item {
		margin-top: 10rpx;
		display: flex;
	}

	.my-reply-box {
		background-color: #F6F6F6;
		padding-bottom: 15rpx;

		.my-comment-box {
			margin: 10rpx 15rpx;

			.my-comment-title {
				font-size: 12rpx;
				font-weight: bold;
				margin-right: 10rpx;
			}

			.my-comment-content {
				font-size: 12rpx;
			}
		}

		.comment-sub-box {
			background-color: white;
			margin: 0rpx 15rpx;
			padding-top: 10rpx;

			.source-box {
				display: flex;
				margin-left: 10rpx;

				.img {
					width: 90rpx;
					height: 90rpx;
					border-radius: 10rpx;
				}

				.content {
					margin: 0rpx 19rpx;
					font-size: 12rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
</style>